#ifndef RANDOM_H
#define RANDOM_H

namespace cg
{
	class Random
	{
	public:
		static void				Seed( unsigned int seed );
		static float			Uniform( void );
		static float			Rand( float min, float max );
		static int				Rand( int max );
	};

	CG_INLINE float Random::Uniform( void )
	{
		int r = ( rand() % RAND_MAX );
		return static_cast<float>( r ) / RAND_MAX;	
	}

	CG_INLINE float Random::Rand( float min, float max )
	{
		assert( min < max );
		float d = max - min;
		float r = Uniform() * d;
		return min + r;
	}

	CG_INLINE int Random::Rand( int max )
	{
		return rand() % max;
	}

	CG_INLINE void Random::Seed( unsigned int seed )
	{
		srand( seed );
	}
}

#endif